from django.shortcuts import render
from django.http import HttpResponse
from .models import BookBase


# Create your views here.
def index(request):
    # 1. 增加数据
    # book = BookBase(id='2', name='小人书', author='我自己', price=121)
    # book.save()
    # 2.查询
    # book = models.BookBase.objects.get(pk=1)
    # 查询所有
    # book = models.BookBase.objects.filter(name='小人书')
    # 3.删除
    book = BookBase.objects.filter(name='hello')
    book.delete()
    return HttpResponse('添加成功')
